package com.github.yoojia.flow;

import com.github.yoojia.flow.util.Console;

/**
 * @author 陈小锅 (yoojiachen@gmail.com)
 * @since 1.0.0
 */
public class Launcher {

    public static void main(String[] args) throws InterruptedException {
        run(args);
    }

    public static void run(String[] args) throws InterruptedException {
        Console console = new Console();
        console.promptForExit();

        GeneralFlow.getInstance()
                .initWithDefaultConfig();
        GeneralFlow.getInstance()
                .start();

        try {
            console.waitForExit();
        } finally {
            GeneralFlow.getInstance()
                    .stop();
        }
    }
}
